﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;


namespace ShopPowerTemplate.Infrastructure
{
    public class LiveConnectUserProfile
    {
        public string id { get; set; }
        public string name { get; set; }
        public string first_name { get; set; }
        public string last_name { get; set; }
        public string gender { get; set; }
        public string locale { get; set; }
        public Dictionary<string, string> emails { get; set; }

        public string AccountEmail
        {
            get
            {
                return emails["account"];
            }
        }

        public override string ToString()
        {
            if (!string.IsNullOrEmpty(first_name) && !string.IsNullOrEmpty(last_name))
            {
                return string.Format("{0} {1}", first_name, last_name);
            }

            return emails["account"];
        }
    }
}
